1. Field of the Invention
The present invention relates to a data processing apparatus and method. In particular, the invention relates to a data processing apparatus and method for maintaining a time count value.
2. Background to the Invention
A data processing apparatus may include a counter for counting a time count value indicating the passage of time, to allow events to be triggered when the counter reaches a given value. For example, in a multi-threading environment, a timer can be set up for triggering a processor to switch between processing one thread and processing another thread when the counter reaches a particular time count value. In another example, an alarm may be set to sound when the time counter reaches a preset value.
Time counters may be provided with multiple modes of operation in which the time counter is updated at different frequencies. This allows a trade off between improved counter precision (using a higher frequency mode) and reduced power consumption (using a lower frequency mode). To ensure that events timed to the counter are triggered at the correct timing, on returning to the higher frequency mode after a period in the lower frequency mode the counter value should be the same as if the counter had been operating in the higher frequency mode all along. To ensure that this requirement is satisfied, the frequency modes have been limited to modes in which the clock signals that clock the counter in each mode are synchronised with one another and have integer ratio frequencies. However, this limits the choice in which frequency modes can be provided.